<?php


namespace app\common\dao\system\common;

use app\common\dao\BaseDao;
use app\common\model\system\common\ProblemCategory as model;
use crmeb\traits\CategoresDao;

class ProblemCateoryDao extends BaseDao
{

    use CategoresDao;

    /**
     * @return string
     * @author fupeng
     */
    protected function getModel(): string
    {
        return model::class;
    }

    /**
     * @return int
     * User: fupeng
     * Date: 2023/10/7
     */
    public function getMaxLevel()
    {
        return 2;
    }

    /**
     * @return array
     * @author fupeng
     * @day 2023/10/7
     */
    public function options()
    {
        return model::getDB()->where('is_show', 1)->order('sort DESC')->column('pid,cate_name', 'common_problem_type_id');
    }
}
